package indi.defoliation.unknownrpg.api.rpgevent;

import java.util.HashMap;

import indi.defoliation.unknownrpg.api.attribute.Attribute;

public class Event implements Cloneable{

	private AttributeActionLogTable table = new AttributeActionLogTable();
	
	private HashMap<String,Object> letter = new HashMap<>();

	public AttributeActionLogTable getTable() {
		return table;
	}

	public void putLog(Attribute att,Event e) {
		table.addAction(att, e);
	}

	public int hashCode() {
		return this.getClass().getName().hashCode();
	}

	public Event clone()
	{
		try {
			return (Event)super.clone();
		} catch (CloneNotSupportedException e) {
			throw new Error(e);
		}
	}
	
	public void putLetter(Attribute att,Object o) {
		letter.put(att.getKeyName(), o);
	}
	
	public boolean hasLetter(String keyName) {
		return letter.containsKey(keyName);
	}
	
	public Object getLetter(String keyName) {
		return letter.get(keyName);
	}
	
}
